package com.xy.ddd.core.convertor;

import com.xy.ddd.core.model.DomainModel;
import com.xy.ddd.core.po.BasePo;
import org.springframework.util.CollectionUtils;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public interface IConvertor<D extends DomainModel, P extends BasePo> {

    D convert(P po);

    P convert(D model);

    /**
     * @param poList 数据库映射实体类
     * @return
     */
    List<D> convert2ModelList(List<P> poList);

    List<P> convert2PoList(List<D> modelList);
}
